From 0132f2f2fc9b6c1ff6b4ae105a5d5bcdb2755836 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 24 Feb 2011 09:32:41 +0000 Subject: [PATCH] x86: Fix mwait usage when doing cpu offline When cpu is offlined, it cannot access per cpu variable at all. This patch avoids using per_cpu variable inside play_dead. Signed-off-by: Shan Haitao Signed-off-by: Wei Gang --- xen/arch/x86/acpi/cpu_idle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c index a55269fcda..bb2da8926b 100644 --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/acpi/cpu_idle.c @@ -569,7 +569,8 @@ static void acpi_dead_idle(void) { case ACPI_CSTATE_EM_FFH: /* Not treat interrupt as break event */ - mwait_idle_with_hints(cx->address, 0); + __monitor((void *)&mwait_wakeup(smp_processor_id()), 0, 0); + __mwait(cx->address, 0); break; case ACPI_CSTATE_EM_SYSIO: inb(cx->address); -- 2.30.2